<?php
class Vs_Answer_Collection
	extends Vs_Collection
{
	public function countPositive()
	{
		$n = 0;
		
		foreach ( $this as $answer){
			if( $answer->value == 1){
				$n++;
			}
		}
		
		return $n;
	}
	
	public function countNegative()
	{
		$n = 0;
	
		foreach ( $this as $answer){
			if( $answer->value == 0){
				$n++;
			}
		}
	
		return $n;
	}
	
	public function total()
	{
		return count($this);
	}
}
